<?php
/*
 * Created by generator
 *
 */

$this->load->helper('form');
$this->load->helper('url');
$this->load->helper('views');
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Editer un adherent</title>
<link rel="stylesheet" href="<?=base_url()?>www/css/screen.css" type="text/css" media="screen" title="default" />
<!--[if IE]>
<link rel="stylesheet" media="all" type="text/css" href="<?=base_url()?>www/css/pro_dropline_ie.css" />
<![endif]-->

<!--  jquery core -->
<script src="<?=base_url()?>www/js/jquery/jquery-1.4.1.min.js" type="text/javascript"></script>

<!-- RAPHAEL JS LIBRARY -->
<script src="<?=base_url()?>www/js/raphael-min.js" type="text/javascript" ></script>
<script src="<?=base_url()?>www/js/raphael-calendar.js" type="text/javascript" ></script>
<!-- /RAPHAEL JS LIBRARY -->


<!--  checkbox styling script -->
<script src="<?=base_url()?>www/js/jquery/ui.core.js" type="text/javascript"></script>
<script src="<?=base_url()?>www/js/jquery/ui.checkbox.js" type="text/javascript"></script>
<script src="<?=base_url()?>www/js/jquery/jquery.bind.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
	$('input').checkBox();
	$('#toggle-all').click(function(){
 	$('#toggle-all').toggleClass('toggle-checked');
	$('#mainform input[type=checkbox]').checkBox('toggle');
	return false;
	});
});
</script>  

<![if !IE 7]>

<!--  styled select box script version 1 -->
<script src="<?=base_url()?>www/js/jquery/jquery.selectbox-0.5.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('.styledselect').selectbox({ inputClass: "selectbox_styled" });
});
</script>
 

<![endif]>

<!--  styled select box script version 2 --> 
<script src="<?=base_url()?>www/js/jquery/jquery.selectbox-0.5_style_2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('.styledselect_form_1').selectbox({ inputClass: "styledselect_form_1" });
	$('.styledselect_form_2').selectbox({ inputClass: "styledselect_form_2" });
});
</script>

<!--  styled select box script version 3 --> 
<script src="<?=base_url()?>www/js/jquery/jquery.selectbox-0.5_style_2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('.styledselect_pages').selectbox({ inputClass: "styledselect_pages" });
});
</script>

<!--  styled file upload script --> 
<script src="<?=base_url()?>www/js/jquery/jquery.filestyle.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
  $(function() {
      $("input.file_1").filestyle({ 
          image: "<?=base_url()?>www/images/forms/choose-file.gif",
          imageheight : 21,
          imagewidth : 78,
          width : 310
      });
  });
</script>

<!-- Custom jquery scripts -->
<script src="<?=base_url()?>www/js/jquery/custom_jquery.js" type="text/javascript"></script>
 
<!-- Tooltips -->
<script src="<?=base_url()?>www/js/jquery/jquery.tooltip.js" type="text/javascript"></script>
<script src="<?=base_url()?>www/js/jquery/jquery.dimensions.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
	$('a.info-tooltip ').tooltip({
		track: true,
		delay: 0,
		fixPNG: true, 
		showURL: false,
		showBody: " - ",
		top: -35,
		left: 5
	});
});
</script> 


<!-- MUST BE THE LAST SCRIPT IN <HEAD></HEAD></HEAD> png fix -->
<script src="<?=base_url()?>www/js/jquery/jquery.pngFix.pack.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$(document).pngFix( );
});
</script>
</head>
<body>

<!-- Start: page-top-outer -->
<div id="page-top-outer">    

<!-- Start: page-top -->
<div id="page-top">

	<!-- start logo -->
	<div id="logo">
	<a href=""><img src="<?=base_url()?>www/images/shared/logo-small.png" alt="" /></a>
	</div>
	<!-- end logo -->
	
	<?= htmlSearch() ?>
	
 	<div class="clear"></div>

</div>
<!-- End: page-top -->

</div>
<!-- End: page-top-outer -->
	
<div class="clear">&nbsp;</div>
 
<!--  start nav-outer-repeat................................................................................................. START -->
<div class="nav-outer-repeat"> 
<!--  start nav-outer -->
<div class="nav-outer"> 

	<?= htmlMyAccount() ?>
	<?= htmlNavigation("adherents","edit"); ?>

</div>
<div class="clear"></div>
<!--  start nav-outer -->
</div>
<!--  start nav-outer-repeat................................................... END -->

 <div class="clear"></div>
 
<!-- start content-outer ........................................................................................................................START -->
<div id="content-outer">
<!-- start content -->
<div id="content">

	<!--  start page-heading -->
	<div id="page-heading">
		<h1>Editer un adhérent</h1>
	</div>
	<!-- end page-heading -->
	
	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="<?=base_url()?>www/images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized"><img src="<?=base_url()?>www/images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td>
		<!--  start content-table-inner ...................................................................... START -->
		<div id="content-table-inner">
		
			<!--  start table-content  -->
			<div id="table-content">
				<!-- start id-form -->
<h2>Fiche signalétique</h2>
				<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
			
<?
$attributes_info = array('name' => 'EditForm');
$fields_info = array('adhidadh' => $adherent->adhidadh);
echo form_open_multipart('editadherent/save', $attributes_info, $fields_info );
?>
		<!-- list of variables - auto-generated : -->
		<tr>
			<td><label title="Nom de l'adhérent" for="adhlbnom">Nom</label> : </td>
			<td><input type="text" name="adhlbnom" id="adhlbnom" class="inp-form-error" value="<?= $adherent->adhlbnom ?>" ></td>
			<td style="vertical-align: top;" rowspan="5">
				<div style="padding-left: 50px; text-align: center;">
				<?php if ( isset($adherent->adhlbpho) ){
					?>
					<img src="<?=base_url()?>www/photosAdherents/<?= $adherent->adhlbpho ?>"><br>
					<p style="margin-left: 30px;margin-top: 5px;"><input type="checkbox" name="checkSuppPhoto"> Supprimer cette photo</p>
				<?php 
				} else {?>
					<img src="<?=base_url()?>www/images/shared/nobody.png"><br>
					<p style="color: #888"><i>Pas de photo...</i></p>
				<?php }?>
				</div>
			</td>
		</tr>
		<tr>
			<td><label title="Prénom de l'adhérent" for="adhlbprn">Prénom</label> : </td>
			<td><input type="text" name="adhlbprn" id="adhlbprn" class="inp-form-error" value="<?= $adherent->adhlbprn ?>" ></td>
			<td></td>
		</tr>
		<tr>
			<td style="vertical-align: top;"><label title="Adresse complète, avec code postal et ville" for="adhtxadr">Adresse</label> : </td>
			<td>
				<textarea rows="5" cols="100" name="adhtxadr" id="adhtxadr" class="form-textarea"><?= $adherent->adhtxadr ?></textarea>
			</td>
			<td></td>
		</tr>
		<tr>
			<td><label title="Téléphone fixe et/ou mobile" for="adhlbtel">Téléphone</label> : </td>
			<td><input type="text" name="adhlbtel" id="adhlbtel" class="inp-form" value="<?= $adherent->adhlbtel ?>" ></td>
			<td></td>
		</tr>
		<tr>
			<td><label title="Adresse e-mail de l'adhérent" for="adhlbmai">Adresse e-mail</label> : </td>
			<td><input type="text" name="adhlbmai" id="adhlbmai" class="inp-form" value="<?= $adherent->adhlbmai ?>" ></td>
			<td></td>
		</tr>
		<tr>
			<td><label title="Photo de l'adhérent" for="adhlbpho_image">Photo</label> : </td>
			<td>
				<input type="file" class="file_1" name="adhlbpho_image" id="adhlbpho_image">
			</td>
			<td>
				<div class="bubble-left"></div>
				<div class="bubble-inner">Photo JPEG (sera réduite)</div>
				<div class="bubble-right"></div>
			</td>
		</tr>
		<tr>
			<td></td>
			<td>
				<input type="submit" value="" class="form-submit" />
				<input type="button" value="" class="form-retour"
					onclick="document.location.href='<?=base_url()?>index.php/listadherents';return false;" />
			</td>
		</tr>
	</table>
	
<?
echo form_close('');
?>

<hr>

<?
$attributes_info = array('name' => 'ChangeSaisonForm');
$fields_info = array('adhidadh' => $adherent->adhidadh);
echo form_open_multipart('editadherent/changeSaison', $attributes_info, $fields_info );
?>
<table width="100%">
	<tr>
		<td nowrap><h2><a name="activites">Liste des activités pratiquées</a> pour <?= $adherent->adhlbprn.' '.$adherent->adhlbnom ?></h2></td>
		<td><label for="idSaison">Saison</label></td>
		<td width="10">
			<select name="idSaison" id="idSaison" class="styledselect_form_1">
				<?php foreach ($saisons as $saison): ?>
				<option value="<?= $saison->saiidsai ?>" <?= ($saison->saiidsai == $saisonEnCours->saiidsai)?("selected"):("")?>><?= $saison->sailbnom ?></option>
				<?php endforeach;?>
			</select>
		</td>
		<td>
			<input type="button" value="" class="form-smallGo"
				onclick="document.forms['ChangeSaisonForm'].submit();return false;" />
		</td>
</table>

<?
echo form_close('');
?>
<br>
			<!-- Calendar -->
			<div id="calendar_holder" style="text-align: center;"></div>
<script type="text/javascript">
var paper = preparePaper("calendar_holder");
var resa = Array();
var textObj = Array();
<?php 
	foreach($activitesAdherent as $activite):
	?>

resa[<?=$activite->actidact?>] = drawReservation(paper,"<?= $activite->actlbjou ?>","<?= $activite->actlbhdb ?>","<?= $activite->actlbdfn ?>").attr(
		{fill: "#bebeff", stroke: "#444", opacity: 1}
	);
paper.rect(resa[<?=$activite->actidact?>].getBBox().x+1, resa[<?=$activite->actidact?>].getBBox().y+1, resa[<?=$activite->actidact?>].getBBox().width-2, resa[<?=$activite->actidact?>].getBBox().height-2, 4).attr(
		{stroke: "none", gradient: "270-rgba(255, 255, 255, 0)-rgba(200, 200, 255, 1):75",opacity: 0}
	);

textObj[<?=$activite->actidact?>] = paper.text( resa[<?=$activite->actidact?>].getBBox().x + (resa[<?=$activite->actidact?>].getBBox().width/2),
		resa[<?=$activite->actidact?>].getBBox().y + (resa[<?=$activite->actidact?>].getBBox().height/2),
		"<?= $activite->actlblib ?>").attr({font: configuration.hoursFontSize + 'px "Arial"'});
textObj[<?=$activite->actidact?>].attr({fill: "#000"});
<?php
	endforeach; 
?>
</script>
			<!-- /Calendar -->


<br>

<?
$attributes_info = array('name' => 'SupprActiviteForm');
$fields_info = array('adhidadh' => $adherent->adhidadh, 'idSaison' => $saisonEnCours->saiidsai, 'actidact' => '');
echo form_open_multipart('editadherent/deleteActivite', $attributes_info, $fields_info );
?>
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
	<tr>
		<th class="table-header-check"></th>
		<!-- table header auto-generated : -->
		<th class="table-header-repeat line-left minwidth-1"><a href="">Libellé</a></th>
		<th class="table-header-repeat line-left minwidth-1"><a href="">Jour</a></th>
		<th class="table-header-repeat line-left minwidth-1"><a href="">Début</a></th>
		<th class="table-header-repeat line-left minwidth-1"><a href="">Fin</a></th>
		<th class="table-header-options line-left"><a href="">Options</a></th>
	</tr>
	<?php
	$even = false;
	foreach($activitesAdherent as $activite):
	?>
	<tr <?=($even)?('class="alternate-row"'):('')?>>
		<td><a href="<?=base_url()?>index.php/editactivite/index/<?=$activite->actidact?>" title="Editer" class="icon-1 info-tooltip"></a></td>
		<td valign="top"><?=$activite->actlblib?> (<?= $niveaux[$activite->actidniv]->nivlbnom ?> <?= $trancheAges[$activite->actidtra]->tralbnom ?>)</td> 
		<td valign="top"><?=$activite->actlbjou?></td> 
		<td valign="top"><?=$activite->actlbhdb?></td> 
		<td valign="top"><?=$activite->actlbdfn?></td> 
		<td class="options-width">
		<a title="Supprimer" class="icon-2 info-tooltip"
			href="javascript:document.forms['SupprActiviteForm'].actidact.value=<?=$activite->actidact?>;document.forms['SupprActiviteForm'].submit();"></a>
		</td>
	</tr>
	<?php 
		$even = !$even; 
	endforeach; ?>

<?
echo form_close('');
?>	
	<tr>
		<td colspan="6">Ajouter une activité</td>
	</tr>

<?
$attributes_info = array('name' => 'AjouterActiviteForm');
$fields_info = array('adhidadh' => $adherent->adhidadh, 'idSaison' => $saisonEnCours->saiidsai, 'actidact' => '');
echo form_open_multipart('editadherent/ajouterActivite', $attributes_info, $fields_info );
?>
	<?php
	$even = false;
	foreach($activitesSaison as $activite):
		if( isset($activitesAdherent[$activite->actidact]) && $activitesAdherent[$activite->actidact]!=null ){
			// activité deja choisie
			continue;
		}
	?>
	<tr <?=($even)?('class="alternate-row"'):('')?>>
		<td><a href="<?=base_url()?>index.php/editactivite/index/<?=$activite->actidact?>" title="Editer" class="icon-1 info-tooltip"></a></td>
		<td valign="top"><?=$activite->actlblib?> (<?= $niveaux[$activite->actidniv]->nivlbnom ?> <?= $trancheAges[$activite->actidtra]->tralbnom ?>)</td> 
		<td valign="top"><?=$activite->actlbjou?></td> 
		<td valign="top"><?=$activite->actlbhdb?></td> 
		<td valign="top"><?=$activite->actlbdfn?></td> 
		<td class="options-width">
		<a title="Choisir" class="icon-5 info-tooltip"
			href="javascript:document.forms['AjouterActiviteForm'].actidact.value=<?=$activite->actidact?>;document.forms['AjouterActiviteForm'].submit();"></a>
		</td>
	</tr>
	<?php 
		$even = !$even; 
	endforeach; ?>

<?
echo form_close('');
?>
</table>


			</div>
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
	<div class="clear">&nbsp;</div>

</div>
<!--  end content -->
<div class="clear">&nbsp;</div>
</div>
<!--  end content-outer........................................................END -->

<div class="clear">&nbsp;</div>
<?php if(isset($goto) && $goto != null ){ ?>
<script type="text/javascript">
document.location.href="#<?= $goto?>";
</script>
<?php }?>

</body>
</html>